3.165 \(\int \csc ^5(e+f x) (a+b \sin (e+f x))^2 \, dx\)

Optimal. Leaf size=110 \[ -\frac {\left (3 a^2+4 b^2\right ) \tanh ^{-1}(\cos (e+f x))}{8 f}-\frac {\left (3 a^2+4 b^2\right ) \cot (e+f x) \csc (e+f x)}{8 f}-\frac {a^2 \cot (e+f x) \csc ^3(e+f x)}{4 f}-\frac {2 a b \cot ^3(e+f x)}{3 f}-\frac {2 a b \cot (e+f x)}{f} \]

[Out]

-1/8*(3*a^2+4*b^2)*arctanh(cos(f*x+e))/f-2*a*b*cot(f*x+e)/f-2/3*a*b*cot(f*x+e)^3/f-1/8*(3*a^2+4*b^2)*cot(f*x+e
)*csc(f*x+e)/f-1/4*a^2*cot(f*x+e)*csc(f*x+e)^3/f

________________________________________________________________________________________

Rubi [A]  time = 0.09, antiderivative size = 110, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {2789, 3767, 3012, 3768, 3770} \[ -\frac {\left (3 a^2+4 b^2\right ) \tanh ^{-1}(\cos (e+f x))}{8 f}-\frac {\left (3 a^2+4 b^2\right ) \cot (e+f x) \csc (e+f x)}{8 f}-\frac {a^2 \cot (e+f x) \csc ^3(e+f x)}{4 f}-\frac {2 a b \cot ^3(e+f x)}{3 f}-\frac {2 a b \cot (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^5*(a + b*Sin[e + f*x])^2,x]

[Out]

-((3*a^2 + 4*b^2)*ArcTanh[Cos[e + f*x]])/(8*f) - (2*a*b*Cot[e + f*x])/f - (2*a*b*Cot[e + f*x]^3)/(3*f) - ((3*a
^2 + 4*b^2)*Cot[e + f*x]*Csc[e + f*x])/(8*f) - (a^2*Cot[e + f*x]*Csc[e + f*x]^3)/(4*f)

Rule 2789

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Dist[(2*c*d)/b
, Int[(b*Sin[e + f*x])^(m + 1), x], x] + Int[(b*Sin[e + f*x])^m*(c^2 + d^2*Sin[e + f*x]^2), x] /; FreeQ[{b, c,
 d, e, f, m}, x]

Rule 3012

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*Cos[e
+ f*x]*(b*Sin[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Dist[(A*(m + 2) + C*(m + 1))/(b^2*(m + 1)), Int[(b*Sin[e
+ f*x])^(m + 2), x], x] /; FreeQ[{b, e, f, A, C}, x] && LtQ[m, -1]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3768

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Csc[c + d*x])^(n - 1))/(d*(n -
 1)), x] + Dist[(b^2*(n - 2))/(n - 1), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1
] && IntegerQ[2*n]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \csc ^5(e+f x) (a+b \sin (e+f x))^2 \, dx &=(2 a b) \int \csc ^4(e+f x) \, dx+\int \csc ^5(e+f x) \left (a^2+b^2 \sin ^2(e+f x)\right ) \, dx\\ &=-\frac {a^2 \cot (e+f x) \csc ^3(e+f x)}{4 f}+\frac {1}{4} \left (3 a^2+4 b^2\right ) \int \csc ^3(e+f x) \, dx-\frac {(2 a b) \operatorname {Subst}\left (\int \left (1+x^2\right ) \, dx,x,\cot (e+f x)\right )}{f}\\ &=-\frac {2 a b \cot (e+f x)}{f}-\frac {2 a b \cot ^3(e+f x)}{3 f}-\frac {\left (3 a^2+4 b^2\right ) \cot (e+f x) \csc (e+f x)}{8 f}-\frac {a^2 \cot (e+f x) \csc ^3(e+f x)}{4 f}+\frac {1}{8} \left (3 a^2+4 b^2\right ) \int \csc (e+f x) \, dx\\ &=-\frac {\left (3 a^2+4 b^2\right ) \tanh ^{-1}(\cos (e+f x))}{8 f}-\frac {2 a b \cot (e+f x)}{f}-\frac {2 a b \cot ^3(e+f x)}{3 f}-\frac {\left (3 a^2+4 b^2\right ) \cot (e+f x) \csc (e+f x)}{8 f}-\frac {a^2 \cot (e+f x) \csc ^3(e+f x)}{4 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B]  time = 0.04, size = 255, normalized size = 2.32 \[ -\frac {a^2 \csc ^4\left (\frac {1}{2} (e+f x)\right )}{64 f}-\frac {3 a^2 \csc ^2\left (\frac {1}{2} (e+f x)\right )}{32 f}+\frac {a^2 \sec ^4\left (\frac {1}{2} (e+f x)\right )}{64 f}+\frac {3 a^2 \sec ^2\left (\frac {1}{2} (e+f x)\right )}{32 f}+\frac {3 a^2 \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{8 f}-\frac {3 a^2 \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{8 f}-\frac {4 a b \cot (e+f x)}{3 f}-\frac {2 a b \cot (e+f x) \csc ^2(e+f x)}{3 f}-\frac {b^2 \csc ^2\left (\frac {1}{2} (e+f x)\right )}{8 f}+\frac {b^2 \sec ^2\left (\frac {1}{2} (e+f x)\right )}{8 f}+\frac {b^2 \log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )}{2 f}-\frac {b^2 \log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )}{2 f} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[Csc[e + f*x]^5*(a + b*Sin[e + f*x])^2,x]

[Out]

(-4*a*b*Cot[e + f*x])/(3*f) - (3*a^2*Csc[(e + f*x)/2]^2)/(32*f) - (b^2*Csc[(e + f*x)/2]^2)/(8*f) - (a^2*Csc[(e
 + f*x)/2]^4)/(64*f) - (2*a*b*Cot[e + f*x]*Csc[e + f*x]^2)/(3*f) - (3*a^2*Log[Cos[(e + f*x)/2]])/(8*f) - (b^2*
Log[Cos[(e + f*x)/2]])/(2*f) + (3*a^2*Log[Sin[(e + f*x)/2]])/(8*f) + (b^2*Log[Sin[(e + f*x)/2]])/(2*f) + (3*a^
2*Sec[(e + f*x)/2]^2)/(32*f) + (b^2*Sec[(e + f*x)/2]^2)/(8*f) + (a^2*Sec[(e + f*x)/2]^4)/(64*f)

________________________________________________________________________________________

fricas [B]  time = 0.47, size = 229, normalized size = 2.08 \[ \frac {6 \, {\left (3 \, a^{2} + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{3} - 6 \, {\left (5 \, a^{2} + 4 \, b^{2}\right )} \cos \left (f x + e\right ) - 3 \, {\left ({\left (3 \, a^{2} + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (3 \, a^{2} + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 3 \, a^{2} + 4 \, b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + 3 \, {\left ({\left (3 \, a^{2} + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (3 \, a^{2} + 4 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 3 \, a^{2} + 4 \, b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + 32 \, {\left (2 \, a b \cos \left (f x + e\right )^{3} - 3 \, a b \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{48 \, {\left (f \cos \left (f x + e\right )^{4} - 2 \, f \cos \left (f x + e\right )^{2} + f\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^5*(a+b*sin(f*x+e))^2,x, algorithm="fricas")

[Out]

1/48*(6*(3*a^2 + 4*b^2)*cos(f*x + e)^3 - 6*(5*a^2 + 4*b^2)*cos(f*x + e) - 3*((3*a^2 + 4*b^2)*cos(f*x + e)^4 -
2*(3*a^2 + 4*b^2)*cos(f*x + e)^2 + 3*a^2 + 4*b^2)*log(1/2*cos(f*x + e) + 1/2) + 3*((3*a^2 + 4*b^2)*cos(f*x + e
)^4 - 2*(3*a^2 + 4*b^2)*cos(f*x + e)^2 + 3*a^2 + 4*b^2)*log(-1/2*cos(f*x + e) + 1/2) + 32*(2*a*b*cos(f*x + e)^
3 - 3*a*b*cos(f*x + e))*sin(f*x + e))/(f*cos(f*x + e)^4 - 2*f*cos(f*x + e)^2 + f)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^5*(a+b*sin(f*x+e))^2,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (4*pi/x/2)>(-4*pi/
x/2)2/f*((8192*tan((f*x+exp(1))/2)^4*a^2+131072/3*tan((f*x+exp(1))/2)^3*b*a+65536*tan((f*x+exp(1))/2)^2*b^2+65
536*tan((f*x+exp(1))/2)^2*a^2+393216*tan((f*x+exp(1))/2)*b*a)/1048576+(-200*tan((f*x+exp(1))/2)^4*b^2-150*tan(
(f*x+exp(1))/2)^4*a^2-144*tan((f*x+exp(1))/2)^3*b*a-24*tan((f*x+exp(1))/2)^2*b^2-24*tan((f*x+exp(1))/2)^2*a^2-
16*tan((f*x+exp(1))/2)*b*a-3*a^2)*1/384/tan((f*x+exp(1))/2)^4+(4*b^2+3*a^2)/16*ln(abs(tan((f*x+exp(1))/2))))

________________________________________________________________________________________

maple [A]  time = 0.43, size = 146, normalized size = 1.33 \[ -\frac {a^{2} \cot \left (f x +e \right ) \left (\csc ^{3}\left (f x +e \right )\right )}{4 f}-\frac {3 a^{2} \cot \left (f x +e \right ) \csc \left (f x +e \right )}{8 f}+\frac {3 a^{2} \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{8 f}-\frac {4 a b \cot \left (f x +e \right )}{3 f}-\frac {2 a b \cot \left (f x +e \right ) \left (\csc ^{2}\left (f x +e \right )\right )}{3 f}-\frac {b^{2} \cot \left (f x +e \right ) \csc \left (f x +e \right )}{2 f}+\frac {b^{2} \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{2 f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^5*(a+b*sin(f*x+e))^2,x)

[Out]

-1/4*a^2*cot(f*x+e)*csc(f*x+e)^3/f-3/8*a^2*cot(f*x+e)*csc(f*x+e)/f+3/8/f*a^2*ln(csc(f*x+e)-cot(f*x+e))-4/3*a*b
*cot(f*x+e)/f-2/3/f*a*b*cot(f*x+e)*csc(f*x+e)^2-1/2/f*b^2*cot(f*x+e)*csc(f*x+e)+1/2/f*b^2*ln(csc(f*x+e)-cot(f*
x+e))

________________________________________________________________________________________

maxima [A]  time = 1.01, size = 147, normalized size = 1.34 \[ \frac {3 \, a^{2} {\left (\frac {2 \, {\left (3 \, \cos \left (f x + e\right )^{3} - 5 \, \cos \left (f x + e\right )\right )}}{\cos \left (f x + e\right )^{4} - 2 \, \cos \left (f x + e\right )^{2} + 1} - 3 \, \log \left (\cos \left (f x + e\right ) + 1\right ) + 3 \, \log \left (\cos \left (f x + e\right ) - 1\right )\right )} + 12 \, b^{2} {\left (\frac {2 \, \cos \left (f x + e\right )}{\cos \left (f x + e\right )^{2} - 1} - \log \left (\cos \left (f x + e\right ) + 1\right ) + \log \left (\cos \left (f x + e\right ) - 1\right )\right )} - \frac {32 \, {\left (3 \, \tan \left (f x + e\right )^{2} + 1\right )} a b}{\tan \left (f x + e\right )^{3}}}{48 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^5*(a+b*sin(f*x+e))^2,x, algorithm="maxima")

[Out]

1/48*(3*a^2*(2*(3*cos(f*x + e)^3 - 5*cos(f*x + e))/(cos(f*x + e)^4 - 2*cos(f*x + e)^2 + 1) - 3*log(cos(f*x + e
) + 1) + 3*log(cos(f*x + e) - 1)) + 12*b^2*(2*cos(f*x + e)/(cos(f*x + e)^2 - 1) - log(cos(f*x + e) + 1) + log(
cos(f*x + e) - 1)) - 32*(3*tan(f*x + e)^2 + 1)*a*b/tan(f*x + e)^3)/f

________________________________________________________________________________________

mupad [B]  time = 6.88, size = 178, normalized size = 1.62 \[ \frac {\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )\,\left (\frac {3\,a^2}{8}+\frac {b^2}{2}\right )}{f}+\frac {a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4}{64\,f}-\frac {{\mathrm {cot}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (2\,a^2+2\,b^2\right )+\frac {a^2}{4}+12\,a\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+\frac {4\,a\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{3}\right )}{16\,f}+\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (\frac {a^2}{8}+\frac {b^2}{8}\right )}{f}+\frac {a\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3}{12\,f}+\frac {3\,a\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{4\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*sin(e + f*x))^2/sin(e + f*x)^5,x)

[Out]

(log(tan(e/2 + (f*x)/2))*((3*a^2)/8 + b^2/2))/f + (a^2*tan(e/2 + (f*x)/2)^4)/(64*f) - (cot(e/2 + (f*x)/2)^4*(t
an(e/2 + (f*x)/2)^2*(2*a^2 + 2*b^2) + a^2/4 + 12*a*b*tan(e/2 + (f*x)/2)^3 + (4*a*b*tan(e/2 + (f*x)/2))/3))/(16
*f) + (tan(e/2 + (f*x)/2)^2*(a^2/8 + b^2/8))/f + (a*b*tan(e/2 + (f*x)/2)^3)/(12*f) + (3*a*b*tan(e/2 + (f*x)/2)
)/(4*f)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**5*(a+b*sin(f*x+e))**2,x)

[Out]

Timed out

________________________________________________________________________________________